package org.ch02.test05;

import org.ch02.entity.Student;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

/**
 * @author lwj
 * @date 2025-03-18
 * @vesion 1.0.0
 */
public class MainTest02 {
    public static void main(String[] args) throws NoSuchFieldException {
        Class<?> clazz = Student.class;

        Field nameField = clazz.getDeclaredField("name");

        // 获取字段的访问修饰符
        int modifiers = nameField.getType().getModifiers();

        boolean b1 = Modifier.isPublic(modifiers);
        System.out.println(b1);
    }
}
